package cn.edu.scau.cmi.zhaoguangfeng.hibernate.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

import cn.edu.scau.cmi.zhaoguangfeng.dao.customize.ScauCmiHibernateSessionFactoryUtil;

public abstract class BaseHibernateDAO<T> {


	public   Session getSession() {
		
		return ScauCmiHibernateSessionFactoryUtil.getSession();
	}
	public abstract void attachClean(T instance) ;
	public abstract void attachDirty(T instance) ;
	public abstract void delete(T persistentInstance) ;
	public abstract List<T> findAll();
	public abstract List<T> findByExample(T instance) ;
	public abstract T findById(Long id) ;
	public abstract List<T> findByName(Object name) ;
	public abstract List<T> findByProperty(String propertyName, Object value );
	public abstract T  merge(T detachedInstance) ;
	public abstract void save(T transientInstance) ;
	
}
